package com.ioandfile;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class PassWordTest2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入用户名");
        String name = scanner.nextLine();
        System.out.println("输入密码");
        String password = scanner.nextLine();

        File file = new File("/Users/edy/Desktop/file/password2.txt");

        try {
            FileUtils.writeStringToFile(file,name + "=" + password +"\n","UTF-8",true);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
